//
//  YCAdView.h
//  Test
//
//  Created by tangkexiong on 16/4/14.
//  Copyright © 2016年 tangkexiong. All rights reserved.
//

#import <UIKit/UIKit.h>

@class YCAdView;

#pragma mark - YCAdView

@protocol YCAdViewDelegate <NSObject>

@required
/// 获取条目数量
- (NSUInteger)numberOfItemsInAdView:(YCAdView *)adView;

@optional
/// 配置每一个条目
- (void)adView:(YCAdView *)adView configItemView:(UIImageView *)imgView atIndex:(NSInteger)index;
/// 点击某个图片
- (void)adView:(YCAdView *)adView didClickAtIndex:(NSInteger)index;
/// 将要进入下一个循环
- (void)adViewWillNextLoop:(YCAdView *)adView;
/// 将要进入上一个循环
- (void)adViewWillLastLoop:(YCAdView *)adView;

@end

/**
 *  广告视图
 */
@interface YCAdView : UIView

/// 代理
@property (nonatomic, weak) id<YCAdViewDelegate> delegate;

/// 当前选择的是第几个
@property (nonatomic, assign) NSInteger selectedIndex;
/// 是否允许无限循环
@property (nonatomic, assign) BOOL infiniteLoopEnable;
/// 轮播时间间隔，秒为单位，时间大于0表示启动轮播
@property (nonatomic, assign) NSTimeInterval intervalForTimer;

/**
 *  刷新数据
 */
- (void)reloadData;
/**
 *  打开定时器
 */
- (void)startTimer;
/**
 *  关闭定时器
 */
- (void)stopTimer;

@end
